/*
* @Author: 窦子滨<zibin_5257@163.com>
* @Date: 2019-12-02 14:08
 */
package main

import (
	"math/rand"
	"time"
)

//进行洗牌
func shuffle(vals []string) []string {
	r := rand.New(rand.NewSource(time.Now().UnixNano()))
	ret := make([]string, len(vals))
	perm := r.Perm(len(vals))
	//log.Info("本次洗牌顺序：%+v",perm)
	for i, randIndex := range perm {
		ret[i] = vals[randIndex]
	}
	return ret
}
